﻿@model AP.Framework.Infrastructure.Entities.cms_Product
@Html.ValidationSummary(true)
<script type="text/javascript">
    $(function () {
        $('#photo_upload').uploadify({
            'swf': '@Url.Content("~/Areas/Admin/Content/uploadify/uploadify.swf")',
            'buttonText': '添加图片...',
            'cancelImg': '@Url.Content("~/Areas/Admin/Content/uploadify/uploadify-cancel.png")',
            'uploader': '/Admin/Products/Upload',
            'auto': true,
            'onUploadSuccess': function (file, data, response) {
                eval("data=" + data);
                $("#Photo").val(data.msg);
                $("#photoImage").attr("src", data.msg);
            }
        });
        $('#photoLarge_upload').uploadify({
            'swf': '@Url.Content("~/Areas/Admin/Content/uploadify/uploadify.swf")',
            'buttonText': '添加图片...',
            'cancelImg': '@Url.Content("~/Areas/Admin/Content/uploadify/uploadify-cancel.png")',
            'uploader': '/Admin/Products/Upload',
            'auto': true,
            'onUploadSuccess': function (file, data, response) {
                eval("data=" + data);
                $("#PhotoLarge").val(data.msg);
                $("#photoLargeImage").attr("src", data.msg);
            }
        });
        $("#photoImage").attr("src", $("#Photo").val());
        $("#photoLargeImage").attr("src", $("#PhotoLarge").val());
    });      
</script>
<br />
<table id="tradeRecordsIndex" class="ui-table">
    <tbody>
        <tr>
            <td class="info">
                产品分类
            </td>
            <td>
                @Html.DropDownListFor(model => model.ProductCategoryId, (IEnumerable<SelectListItem>)ViewBag.proCategoryList)
                @Html.ValidationMessageFor(model => model.ProductCategoryId)
            </td>
        </tr>
        <tr>
            <td class="info">
                产品名称
            </td>
            <td>
                @Html.TextBoxFor(model => model.Name, new { @placeholder = "产品名称", @style = "width:30%" })
                @Html.ValidationMessageFor(model => model.Name)
            </td>
        </tr>
        <tr>
            <td class="info">
                产品图片
            </td>
            <td>
                @Html.TextBoxFor(model => model.Photo, new { @placeholder = "产品图片" })
                <input type="file" name="photo_upload" id="photo_upload" />
                <img id="photoImage" alt="图片缩放显示" src="" style="" />
                @Html.ValidationMessageFor(model => model.Photo)
            </td>
        </tr>
        <tr>
            <td class="info">
                产品大图
            </td>
            <td>
                @Html.TextBoxFor(model => model.PhotoLarge, new { @placeholder = "产品大图" })
                <input type="file" name="photoLarge_upload" id="photoLarge_upload" />
                <img id="photoLargeImage" alt="图片缩放显示" src="" style="" />
                @Html.ValidationMessageFor(model => model.PhotoLarge)
            </td>
        </tr>
        <tr>
            <td class="info">
                描述
            </td>
            <td>
                @Html.TextAreaFor(model => model.Description, new { @placeholder = "描述", @style = "width:80%;height:200px;" })
            @Html.ValidationMessageFor(model => model.Description)
        </tr>
        <tr>
            <td class="info">
                排序号
            </td>
            <td>
                @Html.TextBoxFor(model => model.Sequence, new { @placeholder = "排序号" })
                @Html.ValidationMessageFor(model => model.Sequence)
            </td>
        </tr>
        <tr>
            <td class="info">
                是否隐藏/锁定
            </td>
            <td>
                @Html.CheckBoxFor(model => model.IsDisable)
                @Html.ValidationMessageFor(model => model.IsDisable)
            </td>
        </tr>
        <tr>
            <td class="info">
            </td>
            <td>
                <div class="submit-time ui-button ui-button-sorange">
                    <button type="submit" class="ui-button-text">
                        保 存</button>
                </div>
            </td>
        </tr>
    </tbody>
</table>
